package com.powernode.threadpool;

import org.springframework.stereotype.Component;

import java.util.concurrent.*;

@Component
public class LogThreadPool {

    public static Executor executor() {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                5,
                Runtime.getRuntime().availableProcessors()
                , 30
                , TimeUnit.SECONDS
                , new LinkedBlockingDeque<>(20)
        );
        return threadPoolExecutor;
    }
}
